package main

import (
	"crypto/md5"
	"crypto/sha256"
	"fmt"
)

func jsha256() {
	h := sha256.New()
	h.Write([]byte("abc"))
	r := h.Sum(nil)
	s := fmt.Sprintf("%x", r)
	fmt.Printf("%T %s %d\n", r, s, len(s))
}

func jmd5() {
	h := md5.New()
	h.Write([]byte("abc"))
	fmt.Printf("%T %[1]x\n", h.Sum(nil))
	h.Reset()
	h.Write([]byte("abd"))
	fmt.Printf("%T %[1]x\n", h.Sum(nil))
}

func main() {
	jsha256()
	jmd5()
}
